package com.hr.common.config;

import io.minio.MinioClient;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Slf4j
@Data
@Configuration
@ConfigurationProperties(prefix = "minio") //属性注入 指定配置属性的前缀
public class MinioConfig {
    private String accessKey;
    private String accessSecret;
    private String url;

    @Bean
    public MinioClient creteMC(){
        log.info("url，{}",url);
        return MinioClient.builder().endpoint(url).credentials(accessKey,accessSecret).build();
    }
}
